how to determine the nth term of a quadratic sequence